﻿<UserControl x:Class="Project.AllComplaints"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:my="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
             mc:Ignorable="d" 
             d:DesignHeight="550" d:DesignWidth="900">
    <UserControl.Resources>
        <Style TargetType="{x:Type Expander}">
            <Style.Triggers>
                <EventTrigger RoutedEvent="Expander.Expanded">
                    <EventTrigger.Actions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetProperty="Height" To="180" Duration="0:0:0.5"/>
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger.Actions>
                </EventTrigger>
                <EventTrigger RoutedEvent="Expander.Collapsed">
                    <EventTrigger.Actions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetProperty="Height" To="25" Duration="0:0:0.5"/>
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger.Actions>
                </EventTrigger>
            </Style.Triggers>
        </Style>
        <DataTemplate x:Key="ABItemsTemplate">
            <Border Width="175" BorderBrush="#69810E" BorderThickness="0,0,0,1">
                <StackPanel>
                    <TextBlock Text="{Binding FullName}">
                    </TextBlock>
                    <TextBlock FontSize="9" Text="{Binding CiPassport, StringFormat='Ci: {0}'}" />
                </StackPanel>
            </Border>
        </DataTemplate>
    </UserControl.Resources>
    <Grid Name="Content" >
        <Grid Height="36" Margin="11,11,56,0" Name="gridTitle"  VerticalAlignment="Top">
            <Border BorderBrush="#5C5C5C" BorderThickness="0,0,0,2">
                <TextBlock FontSize="24" FontWeight="Normal" Text="Ver Todas las Denuncias" Width="711" HorizontalAlignment="Left" ></TextBlock>
            </Border>
        </Grid>
        <ScrollViewer Margin="0,52,0,0" ScrollViewer.VerticalScrollBarVisibility="Auto">
        <StackPanel Margin="0,0,0,25">
            <Expander Name="expander" Height="25" Margin="32,10,0,0" Header="Opciones de Búsqueda">
                <Grid Name="expanderGrid" Height="180" >
                    <Label Height="26" Margin="29,62,0,0" Content="Nombre de la víctima:" HorizontalAlignment="Left" Name="label1" VerticalAlignment="Top" />
                    <Label Height="28" Margin="29,105,0,0" Content="Nombre del agresor:" HorizontalAlignment="Left" Name="label2" VerticalAlignment="Top" />
                    <my:AutoCompleteBox Height="26" Margin="151,59,0,0" Width="308" FilterMode="StartsWithOrdinal" TextChanged="TbTextChanged" HorizontalAlignment="Left" Name="tbVictimName"  MinimumPopulateDelay="0" ItemTemplate="{StaticResource ABItemsTemplate}" ValueMemberPath="FullName" VerticalAlignment="Top" DropDownClosing="NameDropDownClosing" PreviewTextInput="VerifyPreviewTextInput" />
                    <my:AutoCompleteBox Height="26" Margin="151,102,0,0" Width="308" FilterMode="StartsWithOrdinal" TextChanged="TbTextChanged" HorizontalAlignment="Left" Name="tbAggressorName"  MinimumPopulateDelay="0" ItemTemplate="{StaticResource ABItemsTemplate}" ValueMemberPath="FullName" VerticalAlignment="Top" DropDownClosing="NameDropDownClosing" PreviewTextInput="VerifyPreviewTextInput"/>
                    <Label Height="28" Margin="473,62,0,0" Content="C.I. Victima:" HorizontalAlignment="Left" Name="label3" VerticalAlignment="Top" />
                    <Label Height="28" Margin="473,102,0,0" Width="61" Content="C.I. Agresor:" HorizontalAlignment="Left" Name="label5" VerticalAlignment="Top" />
                    <my:AutoCompleteBox Height="26" Margin="540,59,0,0" Width="133" FilterMode="StartsWithOrdinal" TextChanged="TbTextChanged" HorizontalAlignment="Left" Name="tbVictimCi"  MinimumPopulateDelay="0" ItemTemplate="{StaticResource ABItemsTemplate}" ValueMemberPath="CiPassport" VerticalAlignment="Top" DropDownClosing="CiDropDownClosing" PreviewTextInput="VerifyPreviewNumberTextInput"/>
                    <my:AutoCompleteBox Height="26" Margin="540,102,0,0" Width="133" FilterMode="StartsWithOrdinal" TextChanged="TbTextChanged" HorizontalAlignment="Left" Name="tbAggressorCi"  MinimumPopulateDelay="0" ItemTemplate="{StaticResource ABItemsTemplate}" ValueMemberPath="CiPassport" VerticalAlignment="Top" DropDownClosing="CiDropDownClosing" PreviewTextInput="VerifyPreviewNumberTextInput"/>
                    <Label Content="Buscar por:" Height="28" HorizontalAlignment="Left" Margin="29,18,0,0" Name="label7" VerticalAlignment="Top" />
                    <RadioButton GroupName="ByWhat" IsChecked="True" Content="Nombre" Height="16" HorizontalAlignment="Left" Margin="94,18,0,0" Name="rbtnByName" VerticalAlignment="Top" Checked="rbtnByName_Checked" />
                    <RadioButton GroupName="ByWhat" Content="C.I." Height="16" HorizontalAlignment="Left" Margin="161,18,0,0" Name="rbtnByCi" VerticalAlignment="Top" Checked="rbtnByCi_Checked" />
                    <Label Content="Buscar por Numero de caso:" Height="16" HorizontalAlignment="Left" Margin="383,18,0,0" Name="label10" VerticalAlignment="Top" />
                    <my:AutoCompleteBox HorizontalAlignment="Left" ValueMemberPath="NumberOfCase" Margin="538,15,0,0" FilterMode="StartsWithOrdinal" Name="tbCaseNumber" ItemTemplate="{StaticResource DetailsSearchTemplate}" VerticalAlignment="Top" Width="67" PreviewTextInput="VerifyPreviewNumberTextInput" DropDownClosing="tbCaseNumber_DropDownClosing" TextChanged="TbTextChanged" />
                </Grid>
        </Expander>
        <Grid Margin="0,10,0,0">
            <ListView Width="836" Height="430" Name="listViewComplaints" ItemsSource="{Binding}" ItemContainerStyle="{DynamicResource ListViewItemContainerStyle}" Margin="32,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Left">
                <ListView.View>
                    <GridView>
                        <GridViewColumn CellTemplate="{StaticResource VictimItemTemplate}" Width="230" Header="Víctima"/>
                        <GridViewColumn CellTemplate="{StaticResource AggressorItemTemplate}" Width="230" Header="Agresor" />
                        <GridViewColumn CellTemplate="{StaticResource InformerItemTemplate}" Width="230" Header="Denunciante" />
                        <GridViewColumn CellTemplate="{StaticResource DetailsItemTemplate}" Width="140" Header="Detalles" />
                    </GridView>
                </ListView.View>
                <ListView.ContextMenu>
                    <ContextMenu Name="ContMenu" >
                                <MenuItem Name="CompleteComplaintRegistration" Header="Completar Registro de Denuncia" Click="CompleteComplaintRegistration_OnClick" />
                                <MenuItem Name="ComplaintOps" Header="Opciones de Denuncia" >
                                    <MenuItem ToolTipService.ShowOnDisabled="True" Name="ViewComplaintOp" Header="Ver Denuncia" Click="ViewComplaint_Click"/>
                                    <MenuItem ToolTipService.ShowOnDisabled="True" Name="ModComplaintOp" Header="Modificar Denuncia" Click="EditCopmlaint_Click"></MenuItem>
                                    <MenuItem ToolTipService.ShowOnDisabled="True" Name="GenerateConclusion" Header="Generar Reporte de Conclusion de Denuncia" IsEnabled="True" Click="MenuItem_OnClick"/>
                                    <MenuItem ToolTipService.ShowOnDisabled="True" Name="RemitCase" Header="Remisión de Caso Investigado" Click="RemissionOfCase_Click"/>
                        </MenuItem>
                                <MenuItem Name="PhotoAlbumOp" ToolTipService.ShowOnDisabled="True" Header="Album de Fotos de Denuncia" Click="PhotoAlbumCopmlaint_Click"/>
                        <MenuItem Name="ReportsOp" Header="Ver Informes Psicologicos" Click="ViewAllPsicologist_Click"/>
                        <MenuItem Name="MedicalOps" Header="Solicitud Evaluacion Médica" >
                            <MenuItem Header="Ver Solicitud Evaluacion Medica"  Click="MenuItem_Click_1"></MenuItem>
                            <MenuItem Name="ModifyMedicalOp" Header="Modificar Solicitud Evaluacion Medica" Click="MenuItem_Click_2" ></MenuItem>
                        </MenuItem>
                                <MenuItem Name="ActionOps" Header="Accion Directa" >
                                    <MenuItem Header="Ver Accion Directa"  Click="MenuItem_Click_4"></MenuItem>
                                    <MenuItem Name="ModifyDirectActionOp" Header="Modificar Accion Directa" Click="MenuItem_Click_6" ></MenuItem>
                                </MenuItem>
                                <MenuItem Name="ViewDeclarationsOp" ToolTipService.ShowOnDisabled="True" Header="Ver Declaraciones" Click="ViewDeclarationsOp_OnClick" />
                                <MenuItem Name="AudiencesOp" Header="Ver Audiencias" Click="ViewAudiences_Click"></MenuItem>
                        <MenuItem Name="Citations" Header="Ver Citaciones" Click="MenuItem_Click_3"/>
                            </ContextMenu>
                </ListView.ContextMenu>
            </ListView>
        </Grid>
        </StackPanel>
        </ScrollViewer>
    </Grid>
</UserControl>
